1. Field of the Invention
The present invention relates to an extension unit for a programmable logic controller, and in particular to an extension unit utilizing an extensive input/output controller to communicate with digital terminals or analog terminals.
2. Description of the Related Art
Programmable logic controllers (PLCs) are a relatively recent development in process control technology. As a part of process control, a PLC is used to monitor input signals from a variety of input terminals (input sensors) which report events and conditions occurring in a controlled process. For example, a PLC can monitor input conditions such as motor speed, temperature, pressure, volumetric flow and the like. A control program is stored in a memory within the PLC to instruct the PLC what actions to take upon encountering particular input signals or conditions. In response to these input signals received from input sensors, the PLC derives and generates output signals which are transmitted via PLC output points to various output devices, such as actuators and relays, to control the process. For example, the output signals generated by the PLC are used to speed up or slow down a conveyer, rotate the arm of a robot, open or close a relay, raise or lower temperature as well as many other possible control functions.
Because conventional PLC system do not have a standard communication interface for external controlled peripherals, hardware engineers must re-design a specific peripheral control interface according to each peripheral unit and data-transmitting format in each application. After the peripheral control circuit is finished, software engineers must write a specific control program according to the peripheral control circuit. The above design process is extremely reliant on the cooperation of hardware and software engineers, who may easily create errors and always take a long time to debug the PLC system. Thus, the conventional PLC system cannot be expanded quickly and flexibly.
Furthermore, when the conventional PLC system includes an extension unit having a display module with multiple 7-segment binary coded decimal (BCD) LEDs or a scan-type keyboard module, a large number of pins of the conventional PLC system must be used to simulate the input/output pins of the display module or the keyboard module. The relative control program saved in the PLC system must be modified case by case. Thus, the peripheral control circuit is complicated, and the fabrication cost is expensive.
Accordingly, an object of the invention is to provide an extension unit with a standard communication interface, or I/O controller, for the conventional PLC system. The conventional PLC system can communicate with the digital or analog terminal devices in the extension unit via the standard communication interface. The extension units with different terminal devices can be preset as different modules, which can reduce the difficulty of fabrication and shorten the modification time.
The present invention provides an input/output controller for an extension unit of a programmable logic controller. The input/output controller has a first port with a plurality of first pins connected to the programmable logic controller and a second port with a plurality of second pins connected to a terminal device. A memory is used to save data received from the first port and the second port. A mode-selecting circuit of the input/output controller includes a plurality of preset operation modes, which determines the input or output type of the first port and the second port, data-transmitting format used by the first and second port, and data-saving format used in the memory.
In a preferred embodiment, the input/output controller further includes a superior serial port and an inferior serial port to connect another two input/output controllers in serial.
Moreover, the input/output controller includes a scan port with a plurality of scan pins. When the mode-selecting circuit is in a scan output mode, data saved in the memory can be transmitted to the terminal device through the second port cooperating with the scan port. When the mode-selecting circuit is in a scan input mode, data in the terminal device can be read through the second port cooperating with the scan port and saved in the memory.
Moreover, the input/output controller includes an analog-to-digital data port and a digital-to-analog data port. When the mode-selecting circuit is in an analog input mode, data in the terminal device can be read through the analog-to-digital data port and saved in the memory. When the mode-selecting circuit is in an analog output mode, data saved in the memory can be transmitted to the terminal device through the digital-to-analog data port.
The present invention also provides an extension unit for a programmable logic controller(PLC). The extension unit includes a terminal device and an input/output controller as described above. Through the input/output controller of the present invention, the PLC can receive data from the terminal device, or can transfer predetermined data to the terminal device.
Furthermore, the terminal device is a display module with a plurality of binary coded decimal 7-segment LEDs, keyboards, thermometers, or heaters.
A detailed description is given in the following embodiments with reference to the accompanying drawings.